package com.ganzhi.service.impl;

import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ganzhi.domain.User;
import com.ganzhi.mapper.UserMapper;
import com.ganzhi.util.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ganzhi.service.impl.service.UserService;

/**
 * (User)表服务实现类
 *
 * @author makejava
 * @since 2025-05-11 15:05:52
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public ResponseResult login(User user) {
        if (user.getUsername().equals("123") && user.getPassword().equals("456")){
            Integer id = user.getId();
            StpUtil.login(id);
            StpUtil.checkLogin();
            String tokenValueByLoginId = StpUtil.getTokenValueByLoginId(id);
            //id获取基本信息
        }
        return new ResponseResult();
    }
}

